package com.foton.lotterydomain.activity.service.stateflow.impl;

import com.foton.lotterycommon.common.Constants;
import com.foton.lotterycommon.common.Result;
import com.foton.lotterydomain.activity.service.stateflow.IStateHandler;
import com.foton.lotterydomain.activity.service.stateflow.StateConfig;
import org.springframework.stereotype.Service;

/**
 * @Author RenPu
 * @Date 2023/12/1 18:13
 * @Version 1.0
 * @Description: 状态处理实现层
 **/

@Service
public class StateHandlerImpl extends StateConfig implements IStateHandler {
    @Override
    public Result arraignment(Long activityId, Enum<Constants.ActivityState> currentStatus) {
        return this.stateMap.get(currentStatus).arraignment(activityId, currentStatus);
    }

    @Override
    public Result checkPass(Long activityId, Enum<Constants.ActivityState> currentStatus) {
        return this.stateMap.get(currentStatus).checkPass(activityId, currentStatus);
    }

    @Override
    public Result checkRefuse(Long activityId, Enum<Constants.ActivityState> currentStatus) {
        return this.stateMap.get(currentStatus).arraignment(activityId, currentStatus);
    }

    @Override
    public Result checkRevoke(Long activityId, Enum<Constants.ActivityState> currentStatus) {
        return this.stateMap.get(currentStatus).arraignment(activityId, currentStatus);
    }

    @Override
    public Result close(Long activityId, Enum<Constants.ActivityState> currentStatus) {
        return this.stateMap.get(currentStatus).arraignment(activityId, currentStatus);
    }

    @Override
    public Result open(Long activityId, Enum<Constants.ActivityState> currentStatus) {
        return this.stateMap.get(currentStatus).arraignment(activityId, currentStatus);
    }

    @Override
    public Result doing(Long activityId, Enum<Constants.ActivityState> currentStatus) {
        return this.stateMap.get(currentStatus).arraignment(activityId, currentStatus);
    }
}
